const express = require('express')
const config = require(process.cwd() + '/src/config/config')
const fileUtils = require(process.cwd() + '/src/utils/file')

let router = express.Router()

/* GET users listing. */
router.post('/', function(req, res) {
  const autotile = req.body.autotile
  
  fileUtils.deleteDir(config.autotilesPath + autotile).then(() => {
    res.sendStatus(200)
  })
  .catch((err) => {
    console.log(err)
    res.sendStatus(500)
  })
})

module.exports = router
